# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Alexandre Filgueira <alexfilgueira@cinnarch.com>
# Based on gnome-control-center:
# Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Jan de Groot <jgc@archlinux.org>

pkgname=cinnamon-control-center
pkgver=6.0.0
pkgrel=1
pkgdesc="The Control Center for Cinnamon"
arch=(loong64 x86_64)
url="https://github.com/linuxmint/${pkgname}"
license=(GPL)
depends=(cinnamon-settings-daemon cinnamon-menus colord
         libgnomekbd libmm-glib nm-connection-editor)
optdepends=('cinnamon-translations: i18n'
            'gnome-color-manager: for color management tasks'
            'gnome-online-accounts: for the online accounts module')
makedepends=(meson samurai gnome-online-accounts)
options=(!emptydirs)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('8dcf3b1a5e0388f5292de27120482c692a79e7c31aea583301ad083a8c449532')
b2sums=('b856e4c258a76aa5e558cca53ac333df81ae135d731a5de65470282e741a95f2c179fbd9f28e8bb26824de5ee1f9b9fcb0143fee1760800149a345085c45f11b')

build() {
  arch-meson build ${pkgname}-${pkgver}
  samu -C build
}

package() {
  DESTDIR="${pkgdir}" samu -C build install
  # https://github.com/linuxmint/Cinnamon/pull/7382#issuecomment-374894901
  # /usr/bin/cinnamon-control-center is not meant for users, it is a development troubleshooting tool.
  # Just install the shell libs/headers.
  rm "${pkgdir}"/usr/bin/cinnamon-control-center
  rm "${pkgdir}"/usr/share/cinnamon-control-center/ui/shell.ui
}
